Mac OS Sound

| Previous | Chapter Contents | Chapter Top | Next |

The Issue of "Endianness"

Multi-platform support raises the issue of "endianness." Basically, endian conversion is treated exactly as a compression conversion. Any non-native endian format will be required to be "decompressed" into the native format. There are three distinct groups to be considered here:

For applications playing audio for any non-native endian formats, you use the CmpSoundHeader , SndDoubleBufferHeader2 , or SoundComponentData with the format set to k16BitLittleEndianFormat . This causes the Sound Manager to install the 16 Bit Little Endian codec into the sound channel. (Note that the SoundHeader , ExtSoundHeader , and SndDoubleBufferHeader structures do not have a format field.)

If you don't want to figure whether it's native or not, just use one of these new headers and fill in the format field. The Sound Manager will do the right thing.

For sound component developers, there are two cases to consider: compressor and decompressor components. The uncompressed formats are assumed to be in native format of the platform. In other words, the input to a compressor is in native format and all output from a decompressor is in native format.

For sound output devices, the Mixer is generating audio in the platform's native format. If the hardware requires non-native format, it is the responsibility of the output device to convert from the native format.


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |